

from appium import webdriver


def init_driver():
    desired_caps = {}
    desired_caps['platformName'] = 'Android'
    # 虚拟 192.168.215.101:5555

    desired_caps['platformVersion'] = '5.1'
    desired_caps['deviceName'] = '192.168.36.101:5555'

    # # letv
    # desired_caps['platformVersion'] = '6.0'
    # desired_caps['deviceName'] = 'FUBI6SDQHYPFZLI7'

    # # 360
    # desired_caps['platformVersion'] = '6.0.1'
    # desired_caps['deviceName'] = '4a72511d'
    # 包名  com.chebao/.MainActivity
    desired_caps['appPackage'] = 'com.chebao'
    desired_caps['appActivity'] = '.MainActivity'
    # 中文
    desired_caps['unicodeKeyboard'] = True
    desired_caps['resetKeyboard'] = True

    # 不要重置应用
    desired_caps['noReset'] = True

    desired_caps['automationName'] = 'Uiautomator2'

    return webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps)





